package chapter.sixth.item32;

import java.util.EnumSet;
import java.util.Set;

import chapter.fifth.item27.GenericUtil;

public class Text {
	public enum Style {BOLD,ITALIC,UNDERLINE,STRIKETHROUGH};
	
	private final Set<Style> styles;
	
	public Text() {
		super();
		styles = GenericUtil.newHashSet();
	}
   
	public void applyStyles(Set<? extends Style> styles){
		this.styles.addAll(styles);
	}
	
	public Set<Style> getStyles() {
		return styles;
	}

	public static void main(String[] args) {
		Text t = new Text();
		t.applyStyles(EnumSet.of(Style.BOLD,Style.ITALIC));
		System.out.println(t.getStyles());
	}
}
